package com.sing.enuns;

import org.apache.commons.lang3.StringUtils;

/**  
* @Title: ResponseEnum.java
* @Package com.kakaloans.micro.pay.commons.enums
* @Description: 响应结果枚举
* @author panzongwei 
* @date 2017年8月8日 下午1:27:36
* @version V1.0  
*/ 
public enum ResponseStatusEnum {
	
	ACCEPT("0", "成功受理请求"),
	EXCEPTION("-1", "系统异常，请稍后再试");

	public final String resCode;
	public final String msg;

	ResponseStatusEnum(String resCode, String msg) {
		this.resCode = resCode;
		this.msg = msg;
	}

	
	public static String getMsgByResCode(String resCode) {
		String msg = null;
		if (StringUtils.isNotBlank(resCode)) {
			for (ResponseStatusEnum em : values()) {
				if (resCode.equals(em.resCode)) {
					msg = em.msg;
					break;
				}
			}
		}
		return msg;
	}

}
